package com.work.model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;
import java.util.List;


/**
 * The persistent class for the Users database table.
 * 
 */
@Entity
@Table(name="Users")
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;
	private int idUsers;
	private String ck;
	private String password;
	private int createdBy;
	private Date creationDate;
	private String email;
	private String firstName;
	private String lastName;
	private int role;
	private int updatedBy;
	private Date updatedDate;
	private List<Card> cardsCreatedBy;
	private List<Card> cardsUpdatedBy;
	private List<Card> cardsOwnBy;
	private List<Project> projectsForUser;
	private List<Project> projectsCreatedBy;
	private List<Project> projectsUpdatedBy;
	private List<Releases> releasesCreatedBy;
	private List<Releases> releasesUpdatedby;
	private List<Sprint> sprintsCreadtedBy;
	private List<Sprint> sprintsUpdatedBy;
	private List<Task> tasksUser;
	private List<Task> tasksCreatedBy;
	private List<Task> tasksUpdatedBy;

	public User() {
	}

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public int getIdUsers() {
		return this.idUsers;
	}

	public void setIdUsers(int idUsers) {
		this.idUsers = idUsers;
	}


	public String getCk() {
		return this.ck;
	}

	public void setCk(String ck) {
		this.ck = ck;
	}


	public int getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(int createdBy) {
		this.createdBy = createdBy;
	}


	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}


	public String getFirstName() {
		return this.firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}


	public String getLastName() {
		return this.lastName;
	}

	public void setLastName(String lastName) {
		this.lastName = lastName;
	}

	public int getRole() {
		return this.role;
	}

	public void setRole(int role) {
		this.role = role;
	}


	public int getUpdatedBy() {
		return this.updatedBy;
	}

	public void setUpdatedBy(int updatedBy) {
		this.updatedBy = updatedBy;
	}


	@Temporal(TemporalType.TIMESTAMP)
	public Date getUpdatedDate() {
		return this.updatedDate;
	}

	public void setUpdatedDate(Date updatedDate) {
		this.updatedDate = updatedDate;
	}


	//bi-directional many-to-one association to Card
	@OneToMany(mappedBy="userCreatedBy")
	public List<Card> getCardsCreatedBy() {
		return this.cardsCreatedBy;
	}

	public void setCardsCreatedBy(List<Card> cardsCreatedBy) {
		this.cardsCreatedBy = cardsCreatedBy;
	}

	public Card addCardsCreatedBy(Card cardsCreatedBy) {
		getCardsCreatedBy().add(cardsCreatedBy);
		cardsCreatedBy.setUserCreatedBy(this);

		return cardsCreatedBy;
	}

	public Card removeCardsCreatedBy(Card cardsCreatedBy) {
		getCardsCreatedBy().remove(cardsCreatedBy);
		cardsCreatedBy.setUserCreatedBy(null);

		return cardsCreatedBy;
	}


	//bi-directional many-to-one association to Card
	@OneToMany(mappedBy="userUpdatedBy")
	public List<Card> getCardsUpdatedBy() {
		return this.cardsUpdatedBy;
	}

	public void setCardsUpdatedBy(List<Card> cardsUpdatedBy) {
		this.cardsUpdatedBy = cardsUpdatedBy;
	}

	public Card addCardsUpdatedBy(Card cardsUpdatedBy) {
		getCardsUpdatedBy().add(cardsUpdatedBy);
		cardsUpdatedBy.setUserUpdatedBy(this);

		return cardsUpdatedBy;
	}

	public Card removeCardsUpdatedBy(Card cardsUpdatedBy) {
		getCardsUpdatedBy().remove(cardsUpdatedBy);
		cardsUpdatedBy.setUserUpdatedBy(null);

		return cardsUpdatedBy;
	}


	//bi-directional many-to-one association to Card
	@OneToMany(mappedBy="userOwnBy")
	public List<Card> getCardsOwnBy() {
		return this.cardsOwnBy;
	}

	public void setCardsOwnBy(List<Card> cardsOwnBy) {
		this.cardsOwnBy = cardsOwnBy;
	}

	public Card addCardsOwnBy(Card cardsOwnBy) {
		getCardsOwnBy().add(cardsOwnBy);
		cardsOwnBy.setUserOwnBy(this);

		return cardsOwnBy;
	}

	public Card removeCardsOwnBy(Card cardsOwnBy) {
		getCardsOwnBy().remove(cardsOwnBy);
		cardsOwnBy.setUserOwnBy(null);

		return cardsOwnBy;
	}


	//bi-directional many-to-one association to Project
	@OneToMany(mappedBy="userPM")
	public List<Project> getProjectsForUser() {
		return this.projectsForUser;
	}

	public void setProjectsForUser(List<Project> projectsForUser) {
		this.projectsForUser = projectsForUser;
	}

	public Project addProjectsForUser(Project projectsForUser) {
		getProjectsForUser().add(projectsForUser);
		projectsForUser.setUserPM(this);

		return projectsForUser;
	}

	public Project removeProjectsForUser(Project projectsForUser) {
		getProjectsForUser().remove(projectsForUser);
		projectsForUser.setUserPM(null);

		return projectsForUser;
	}


	//bi-directional many-to-one association to Project
	@OneToMany(mappedBy="userCreatedBy")
	public List<Project> getProjectsCreatedBy() {
		return this.projectsCreatedBy;
	}

	public void setProjectsCreatedBy(List<Project> projectsCreatedBy) {
		this.projectsCreatedBy = projectsCreatedBy;
	}

	public Project addProjectsCreatedBy(Project projectsCreatedBy) {
		getProjectsCreatedBy().add(projectsCreatedBy);
		projectsCreatedBy.setUserCreatedBy(this);

		return projectsCreatedBy;
	}

	public Project removeProjectsCreatedBy(Project projectsCreatedBy) {
		getProjectsCreatedBy().remove(projectsCreatedBy);
		projectsCreatedBy.setUserCreatedBy(null);

		return projectsCreatedBy;
	}


	//bi-directional many-to-one association to Project
	@OneToMany(mappedBy="userUpdatedBy")
	public List<Project> getProjectsUpdatedBy() {
		return this.projectsUpdatedBy;
	}

	public void setProjectsUpdatedBy(List<Project> projectsUpdatedBy) {
		this.projectsUpdatedBy = projectsUpdatedBy;
	}

	public Project addProjectsUpdatedBy(Project projectsUpdatedBy) {
		getProjectsUpdatedBy().add(projectsUpdatedBy);
		projectsUpdatedBy.setUserUpdatedBy(this);

		return projectsUpdatedBy;
	}

	public Project removeProjectsUpdatedBy(Project projectsUpdatedBy) {
		getProjectsUpdatedBy().remove(projectsUpdatedBy);
		projectsUpdatedBy.setUserUpdatedBy(null);

		return projectsUpdatedBy;
	}


	//bi-directional many-to-one association to Releases
	@OneToMany(mappedBy="userCreatedBy")
	public List<Releases> getReleasesCreatedBy() {
		return this.releasesCreatedBy;
	}

	public void setReleasesCreatedBy(List<Releases> releasesCreatedBy) {
		this.releasesCreatedBy = releasesCreatedBy;
	}

	public Releases addReleasesCreatedBy(Releases releasesCreatedBy) {
		getReleasesCreatedBy().add(releasesCreatedBy);
		releasesCreatedBy.setUserCreatedBy(this);

		return releasesCreatedBy;
	}

	public Releases removeReleasesCreatedBy(Releases releasesCreatedBy) {
		getReleasesCreatedBy().remove(releasesCreatedBy);
		releasesCreatedBy.setUserCreatedBy(null);

		return releasesCreatedBy;
	}


	//bi-directional many-to-one association to Releases
	@OneToMany(mappedBy="userUpdatedBy")
	public List<Releases> getReleasesUpdatedby() {
		return this.releasesUpdatedby;
	}

	public void setReleasesUpdatedby(List<Releases> releasesUpdatedby) {
		this.releasesUpdatedby = releasesUpdatedby;
	}

	public Releases addReleasesUpdatedby(Releases releasesUpdatedby) {
		getReleasesUpdatedby().add(releasesUpdatedby);
		releasesUpdatedby.setUserUpdatedBy(this);

		return releasesUpdatedby;
	}

	public Releases removeReleasesUpdatedby(Releases releasesUpdatedby) {
		getReleasesUpdatedby().remove(releasesUpdatedby);
		releasesUpdatedby.setUserUpdatedBy(null);

		return releasesUpdatedby;
	}


	//bi-directional many-to-one association to Sprint
	@OneToMany(mappedBy="userCreatedBy")
	public List<Sprint> getSprintsCreadtedBy() {
		return this.sprintsCreadtedBy;
	}

	public void setSprintsCreadtedBy(List<Sprint> sprintsCreadtedBy) {
		this.sprintsCreadtedBy = sprintsCreadtedBy;
	}

	public Sprint addSprintsCreadtedBy(Sprint sprintsCreadtedBy) {
		getSprintsCreadtedBy().add(sprintsCreadtedBy);
		sprintsCreadtedBy.setUserCreatedBy(this);

		return sprintsCreadtedBy;
	}

	public Sprint removeSprintsCreadtedBy(Sprint sprintsCreadtedBy) {
		getSprintsCreadtedBy().remove(sprintsCreadtedBy);
		sprintsCreadtedBy.setUserCreatedBy(null);

		return sprintsCreadtedBy;
	}


	//bi-directional many-to-one association to Sprint
	@OneToMany(mappedBy="userUpdatedBy")
	public List<Sprint> getSprintsUpdatedBy() {
		return this.sprintsUpdatedBy;
	}

	public void setSprintsUpdatedBy(List<Sprint> sprintsUpdatedBy) {
		this.sprintsUpdatedBy = sprintsUpdatedBy;
	}

	public Sprint addSprintsUpdatedBy(Sprint sprintsUpdatedBy) {
		getSprintsUpdatedBy().add(sprintsUpdatedBy);
		sprintsUpdatedBy.setUserUpdatedBy(this);

		return sprintsUpdatedBy;
	}

	public Sprint removeSprintsUpdatedBy(Sprint sprintsUpdatedBy) {
		getSprintsUpdatedBy().remove(sprintsUpdatedBy);
		sprintsUpdatedBy.setUserUpdatedBy(null);

		return sprintsUpdatedBy;
	}


	//bi-directional many-to-one association to Task
	@OneToMany(mappedBy="userTasks")
	public List<Task> getTasksUser() {
		return this.tasksUser;
	}

	public void setTasksUser(List<Task> tasksUser) {
		this.tasksUser = tasksUser;
	}

	public Task addTasksUser(Task tasksUser) {
		getTasksUser().add(tasksUser);
		tasksUser.setUserTasks(this);

		return tasksUser;
	}

	public Task removeTasksUser(Task tasksUser) {
		getTasksUser().remove(tasksUser);
		tasksUser.setUserTasks(null);

		return tasksUser;
	}


	//bi-directional many-to-one association to Task
	@OneToMany(mappedBy="userCreatedBy")
	public List<Task> getTasksCreatedBy() {
		return this.tasksCreatedBy;
	}

	public void setTasksCreatedBy(List<Task> tasksCreatedBy) {
		this.tasksCreatedBy = tasksCreatedBy;
	}

	public Task addTasksCreatedBy(Task tasksCreatedBy) {
		getTasksCreatedBy().add(tasksCreatedBy);
		tasksCreatedBy.setUserCreatedBy(this);

		return tasksCreatedBy;
	}

	public Task removeTasksCreatedBy(Task tasksCreatedBy) {
		getTasksCreatedBy().remove(tasksCreatedBy);
		tasksCreatedBy.setUserCreatedBy(null);

		return tasksCreatedBy;
	}


	//bi-directional many-to-one association to Task
	@OneToMany(mappedBy="userUpdatedBy")
	public List<Task> getTasksUpdatedBy() {
		return this.tasksUpdatedBy;
	}

	public void setTasksUpdatedBy(List<Task> tasksUpdatedBy) {
		this.tasksUpdatedBy = tasksUpdatedBy;
	}

	public Task addTasksUpdatedBy(Task tasksUpdatedBy) {
		getTasksUpdatedBy().add(tasksUpdatedBy);
		tasksUpdatedBy.setUserUpdatedBy(this);

		return tasksUpdatedBy;
	}

	public Task removeTasksUpdatedBy(Task tasksUpdatedBy) {
		getTasksUpdatedBy().remove(tasksUpdatedBy);
		tasksUpdatedBy.setUserUpdatedBy(null);

		return tasksUpdatedBy;
	}

}